#include "dailywindow.h"

#include <QPushButton>
#include <QIcon>
#include <QLabel>
#include <QPixmap>
#include <QTextEdit>
#include <QFont>

DailyWindow::DailyWindow(QWidget *parent)
    : QMainWindow{parent}
{
    this->setWindowTitle("学生管理系统");
    this->setWindowIcon(QIcon(":/Picture/Picture/windowTitle.png"));
    this->setFixedSize(600,800);
    QLabel *backgroundLabel = new QLabel;
    backgroundLabel->setFixedSize(600,800);
    QPixmap backgroundPixmap(":/Picture/Picture//background.png");
    backgroundLabel->setPixmap(backgroundPixmap.scaled(backgroundLabel->size(), Qt::KeepAspectRatio));
    this->setCentralWidget(backgroundLabel);

    //创建对话框以传达提示信息
    QTextEdit* textEdit = new QTextEdit(this);
    textEdit->setReadOnly(true); // 设置文本框为只读
    textEdit->setGeometry(70, 50, 460, 200); // 设置位置和大小
    textEdit->setPlainText("请选择所需功能！"); // 设置初始文本
    textEdit->setStyleSheet("QTextEdit { background: transparent;"
                            "border: 2px solid #000000; " //设置边框为2像素宽，黑色
                            "border-radius: 5px; " // 设置边框圆角半径
                            "transition: background-color 0.3s ease; " //添加过渡效果 }"); //设置文本框透明
                            "}");
    QFont font;
    font.setPointSize(18); // 设置字体大小
    font.setFamily("华文新魏"); // 设置字体族
    textEdit->setFont(font); //应用字体到文本框
    //添加功能：记录今日上课情况、修改某学生今日考勤
    QPushButton * recordToday = new QPushButton("记录今日上课情况",this);
    recordToday->setFixedSize(240,70);
    recordToday->move(180,390);
    recordToday->setFont(font);
    recordToday->setStyleSheet("QPushButton { "
                               "background-color: transparent; " //设置背景色为透明
                               "border: 2px solid #000000; " //设置边框为2像素宽，黑色
                               "border-radius: 5px; " // 设置边框圆角半径
                               "transition: background-color 0.3s ease; " //添加过渡效果
                               "}"
                               "QPushButton:hover { "
                               "background-color: #ADD8E6; " //鼠标悬停时设置背景色为浅蓝色
                               "}");
    QPushButton * modifyStudentToday = new QPushButton("修改某学生今日考勤",this);
    modifyStudentToday->setFixedSize(240,70);
    modifyStudentToday->move(180,590);
    modifyStudentToday->setFont(font);
    modifyStudentToday->setStyleSheet("QPushButton { "
                               "background-color: transparent; " //设置背景色为透明
                               "border: 2px solid #000000; " //设置边框为2像素宽，黑色
                               "border-radius: 5px; " // 设置边框圆角半径
                               "transition: background-color 0.3s ease; " //添加过渡效果
                               "}"
                               "QPushButton:hover { "
                               "background-color: #ADD8E6; " //鼠标悬停时设置背景色为浅蓝色
                               "}");
}
